#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int cmp_int(const void* e1, const void* e2)
{
    return *(int*)e1 - *(int*)e2;
}
int main() {
    int n = 0;
    cin >> n;
    int arr[3 * n];
    for (int i = 0; i < 3 * n; i++)
    {
        cin >> arr[i];
    }
    qsort(arr, 3 * n, 4, cmp_int);
    int count = 0;
    for (int i = 0; i < n; i++)
    {
        printf("%d", arr[n - 2(i + 1)]);
    }
    cout << count << endl;
}